name: Add codesandbox link

on:
  pull_request:
    # types: [opened]
  # https://github.com/mshick/add-pr-comment/issues/25
  # pull_request_target:
    # types: [opened]

jobs:
  codesandbox-comment:
    name: Add codesandbox link comment
    runs-on: ubuntu-latest
    permissions:
        pull-requests: write
    steps:
      - uses: mshick/add-pr-comment@v2
        with:
          message: |
            You can check this code at CodeSandbox with the link
            https://githubbox.com/${{ github.repository }}/tree/${{ github.head_ref }}
            Also, you can check build at CodeSandbox with the link
            https://githubbox.com/${{ github.repository }}/tree/gh-pages